import request from '@/utils/request'

// 查询产品分类列表
export function listProductCategory(query) {
  return request({
    url: '/crm/productCategory/list',
    method: 'get',
    params: query
  })
}

// 查询产品分类详细
export function getProductCategory(categoryId) {
  return request({
    url: '/crm/productCategory/' + categoryId,
    method: 'get'
  })
}

// 新增产品分类
export function addProductCategory(data) {
  return request({
    url: '/crm/productCategory',
    method: 'post',
    data: data
  })
}

// 修改产品分类
export function updateProductCategory(data) {
  return request({
    url: '/crm/productCategory',
    method: 'put',
    data: data
  })
}

// 删除产品分类
export function delProductCategory(categoryId) {
  return request({
    url: '/crm/productCategory/' + categoryId,
    method: 'delete'
  })
}

// 导出产品分类
export function exportProductCategory(query) {
  return request({
    url: '/crm/productCategory/export',
    method: 'get',
    params: query
  })
}

// 查询下拉树结构
export function treeselect() {
  return request({
    url: '/crm/productCategory/treeselect',
    method: 'get'
  })
}

export function getAllProductCates() {
  return request({
    url: '/crm/productCategory/getAllProductCates',
    method: 'get'
  })
}
